//#ifndef CUSTOMWEBENGINEVIEW_H
//#define CUSTOMWEBENGINEVIEW_H

//#include <QWebEngineView>
//#include <QMainWindow>

//class CustomWebEngineView : public QWebEngineView {
//    Q_OBJECT
//public:
//    explicit CustomWebEngineView(QWidget *parent = nullptr);

//protected:
//    QWebEngineView* createWindow(QWebEnginePage::WebWindowType type) override;
//};

//#endif // CUSTOMWEBENGINEVIEW_H



// --------------------------
//#ifndef CUSTOMWEBENGINEVIEW_H
//#define CUSTOMWEBENGINEVIEW_H

//#include <QWebEngineView>
//#include <QWebEnginePage>
//#include <QMainWindow>

//class CustomWebEngineView : public QWebEngineView {
//    Q_OBJECT
//public:
//    explicit CustomWebEngineView(QWidget *parent = nullptr);

//protected:
//    QWebEngineView* createWindow(QWebEnginePage::WebWindowType type) override; // 返回类型修正为 QWebEngineView*
//};

//#endif // CUSTOMWEBENGINEVIEW_H


// ------------------

#ifndef CUSTOMWEBENGINEVIEW_H
#define CUSTOMWEBENGINEVIEW_H

#include <QWebEngineView>
#include <QWebEnginePage>

class CustomWebEngineView : public QWebEngineView {
    Q_OBJECT
public:
    explicit CustomWebEngineView(QWidget *parent = nullptr);

protected:
    QWebEngineView* createWindow(QWebEnginePage::WebWindowType type) override; // 重写以在当前窗口加载
};

#endif // CUSTOMWEBENGINEVIEW_H
